package com.wzy.designpattern.behavioral.templateemethod;

/**
 * 描述
 * 创建人    Wzy
 * 创建时间: 2020-05-16  16:05
 */
public abstract class ACourse {
    protected final void makeCourse() {
        this.makePPt();
        this.makeVideo();
        if (needWriteArticle()) {
            this.writeArticle();
        }
        this.packageCourse();
    }

    final void makePPt() {
        System.out.println("制作PPT");
    }

    final void makeVideo() {
        System.out.println("制作视频");
    }

    final void writeArticle() {
        System.out.println("编写手记");
    }

    //钩子方法
    protected boolean needWriteArticle() {
        return false;
    }

    abstract void packageCourse();

}
